#include "BulletCollision/Gimpact/gim_tri_collision.h"
#ifdef __cplusplus
extern "C" {
#endif
GIM_TRIANGLE_CONTACT_DATA* bullet_NewGIM_TRIANGLE_CONTACT_DATA(){
	GIM_TRIANGLE_CONTACT_DATA* wrap_out = new GIM_TRIANGLE_CONTACT_DATA();
	return wrap_out;
}

GIM_TRIANGLE_CONTACT_DATA* bullet_NewGIM_TRIANGLE_CONTACT_DATA1(GIM_TRIANGLE_CONTACT_DATA* other){
	GIM_TRIANGLE_CONTACT_DATA const& c_arg_other=(GIM_TRIANGLE_CONTACT_DATA const&)(*other);
	GIM_TRIANGLE_CONTACT_DATA* wrap_out = new GIM_TRIANGLE_CONTACT_DATA(c_arg_other);
	return wrap_out;
}

void bullet_GIM_TRIANGLE_CONTACT_DATA_copy_from(GIM_TRIANGLE_CONTACT_DATA* c_this,GIM_TRIANGLE_CONTACT_DATA* other){
	GIM_TRIANGLE_CONTACT_DATA const& c_arg_other=(GIM_TRIANGLE_CONTACT_DATA const&)(*other);
	c_this->copy_from(c_arg_other);
}

double bullet_GIM_TRIANGLE_CONTACT_DATA_GetFieldOfM_penetration_depth(GIM_TRIANGLE_CONTACT_DATA* c_this){
	return (double)(c_this->m_penetration_depth);
}

unsigned int bullet_GIM_TRIANGLE_CONTACT_DATA_GetFieldOfM_point_count(GIM_TRIANGLE_CONTACT_DATA* c_this){
	return (unsigned int)(c_this->m_point_count);
}

btVector3** bullet_GIM_TRIANGLE_CONTACT_DATA_GetFieldOfM_points(GIM_TRIANGLE_CONTACT_DATA* c_this){
	return (btVector3**)(&c_this->m_points);
}

btVector4* bullet_GIM_TRIANGLE_CONTACT_DATA_GetFieldOfM_separating_normal(GIM_TRIANGLE_CONTACT_DATA* c_this){
	return (btVector4*)(&c_this->m_separating_normal);
}

void bullet_GIM_TRIANGLE_CONTACT_DATA_merge_points(GIM_TRIANGLE_CONTACT_DATA* c_this,btVector4* plane,double margin,btVector3* points,unsigned int point_count){
	btVector4 const& c_arg_plane=(btVector4 const&)(*plane);
	btScalar c_arg_margin=margin;
	btVector3 const * c_arg_points=(btVector3 const *)(void*)(points);
	unsigned int c_arg_point_count=point_count;
	c_this->merge_points(c_arg_plane,c_arg_margin,c_arg_points,c_arg_point_count);
}

GIM_TRIANGLE* bullet_NewGIM_TRIANGLE(){
	GIM_TRIANGLE* wrap_out = new GIM_TRIANGLE();
	return wrap_out;
}

void bullet_GIM_TRIANGLE_apply_transform(GIM_TRIANGLE* c_this,btTransform* trans){
	btTransform const& c_arg_trans=(btTransform const&)(*trans);
	c_this->apply_transform(c_arg_trans);
}

bool bullet_GIM_TRIANGLE_collide_triangle(GIM_TRIANGLE* c_this,GIM_TRIANGLE* other,GIM_TRIANGLE_CONTACT_DATA* contact_data){
	GIM_TRIANGLE const& c_arg_other=(GIM_TRIANGLE const&)(*other);
	GIM_TRIANGLE_CONTACT_DATA& c_arg_contact_data=(GIM_TRIANGLE_CONTACT_DATA&)(*contact_data);
	bool c_out = c_this->collide_triangle(c_arg_other,c_arg_contact_data);
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_GIM_TRIANGLE_collide_triangle_hard_test(GIM_TRIANGLE* c_this,GIM_TRIANGLE* other,GIM_TRIANGLE_CONTACT_DATA* contact_data){
	GIM_TRIANGLE const& c_arg_other=(GIM_TRIANGLE const&)(*other);
	GIM_TRIANGLE_CONTACT_DATA& c_arg_contact_data=(GIM_TRIANGLE_CONTACT_DATA&)(*contact_data);
	bool c_out = c_this->collide_triangle_hard_test(c_arg_other,c_arg_contact_data);
	bool wrap_out = (c_out);
	return wrap_out;
}

GIM_AABB* bullet_GIM_TRIANGLE_get_box(GIM_TRIANGLE* c_this){
	GIM_AABB c_out = c_this->get_box();
	GIM_AABB* wrap_out = new GIM_AABB(c_out);
	return wrap_out;
}

void bullet_GIM_TRIANGLE_get_edge_plane(GIM_TRIANGLE* c_this,unsigned int edge_index,btVector3* triangle_normal,btVector4* plane){
	unsigned int c_arg_edge_index=edge_index;
	btVector3 const& c_arg_triangle_normal=(btVector3 const&)(*triangle_normal);
	btVector4& c_arg_plane=(btVector4&)(*plane);
	c_this->get_edge_plane(c_arg_edge_index,c_arg_triangle_normal,c_arg_plane);
}

void bullet_GIM_TRIANGLE_get_normal(GIM_TRIANGLE* c_this,btVector3* normal){
	btVector3& c_arg_normal=(btVector3&)(*normal);
	c_this->get_normal(c_arg_normal);
}

void bullet_GIM_TRIANGLE_get_plane(GIM_TRIANGLE* c_this,btVector4* plane){
	btVector4& c_arg_plane=(btVector4&)(*plane);
	c_this->get_plane(c_arg_plane);
}

void bullet_GIM_TRIANGLE_get_triangle_transform(GIM_TRIANGLE* c_this,btTransform* triangle_transform){
	btTransform& c_arg_triangle_transform=(btTransform&)(*triangle_transform);
	c_this->get_triangle_transform(c_arg_triangle_transform);
}

bool bullet_GIM_TRIANGLE_get_uv_parameters(GIM_TRIANGLE* c_this,btVector3* point,btVector3* tri_plane,double* u,double* v){
	btVector3 const& c_arg_point=(btVector3 const&)(*point);
	btVector3 const& c_arg_tri_plane=(btVector3 const&)(*tri_plane);
	btScalar& c_arg_u=(btScalar&)(*u);
	btScalar& c_arg_v=(btScalar&)(*v);
	bool c_out = c_this->get_uv_parameters(c_arg_point,c_arg_tri_plane,c_arg_u,c_arg_v);
	bool wrap_out = (c_out);
	return wrap_out;
}

double bullet_GIM_TRIANGLE_GetFieldOfM_margin(GIM_TRIANGLE* c_this){
	return (double)(c_this->m_margin);
}

btVector3** bullet_GIM_TRIANGLE_GetFieldOfM_vertices(GIM_TRIANGLE* c_this){
	return (btVector3**)(&c_this->m_vertices);
}

bool bullet_GIM_TRIANGLE_is_point_inside(GIM_TRIANGLE* c_this,btVector3* point,btVector3* tri_normal){
	btVector3 const& c_arg_point=(btVector3 const&)(*point);
	btVector3 const& c_arg_tri_normal=(btVector3 const&)(*tri_normal);
	bool c_out = c_this->is_point_inside(c_arg_point,c_arg_tri_normal);
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_GIM_TRIANGLE_ray_collision(GIM_TRIANGLE* c_this,btVector3* vPoint,btVector3* vDir,btVector3* pout,btVector3* triangle_normal,double* tparam,double tmax){
	btVector3 const& c_arg_vPoint=(btVector3 const&)(*vPoint);
	btVector3 const& c_arg_vDir=(btVector3 const&)(*vDir);
	btVector3& c_arg_pout=(btVector3&)(*pout);
	btVector3& c_arg_triangle_normal=(btVector3&)(*triangle_normal);
	btScalar& c_arg_tparam=(btScalar&)(*tparam);
	btScalar c_arg_tmax=tmax;
	bool c_out = c_this->ray_collision(c_arg_vPoint,c_arg_vDir,c_arg_pout,c_arg_triangle_normal,c_arg_tparam,c_arg_tmax);
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_GIM_TRIANGLE_ray_collision_front_side(GIM_TRIANGLE* c_this,btVector3* vPoint,btVector3* vDir,btVector3* pout,btVector3* triangle_normal,double* tparam,double tmax){
	btVector3 const& c_arg_vPoint=(btVector3 const&)(*vPoint);
	btVector3 const& c_arg_vDir=(btVector3 const&)(*vDir);
	btVector3& c_arg_pout=(btVector3&)(*pout);
	btVector3& c_arg_triangle_normal=(btVector3&)(*triangle_normal);
	btScalar& c_arg_tparam=(btScalar&)(*tparam);
	btScalar c_arg_tmax=tmax;
	bool c_out = c_this->ray_collision_front_side(c_arg_vPoint,c_arg_vDir,c_arg_pout,c_arg_triangle_normal,c_arg_tparam,c_arg_tmax);
	bool wrap_out = (c_out);
	return wrap_out;
}

#ifdef __cplusplus
}
#endif
